<template>
	<view>
		<view class="themeLinearBgColor">
			<safeTopVue :backgroundColor="'var(--homePageBackground)'" />
			<view class="rowStart ps20 gap20">
				<view class="w100 search-area mtb20">
					<uv-input placeholder="商户账号、门店名称、公司名称" border="0" placeholderStyle="color:#fff;">
						<!-- vue3模式下必须使用v-slot:prefix -->
						<template v-slot:prefix>
							<uv-icon name="search" color="#fff"></uv-icon>
						</template>
					</uv-input>
				</view>
				<uv-icon name="scan" color="#fff" size="26"></uv-icon>
			</view>
			<view class="rowSpaceAround">
				<view class="cloumCenter gap20 pv20" v-for="(item,index) in pageList" :key="index"
					@click="gotoPage(item.page)">
					<image :src="item.icon" mode="widthFix" style="width: 50rpx;"></image>
					<view class="defultText">
						{{item.title}}
					</view>
				</view>
			</view>

		</view>
		<view class="defultBackground">
			<tabsComponent :tabsList="list" @handleTabClick="click" />
		</view>
		<view class="cloumCenter">
			<auditShopVue :items="items" />
		</view>
	</view>
</template>

<script>
	import auditShopVue from './auditShop.vue';
	import {
		storeListApi
	} from '../../../api/store.js'
	import tabsComponent from '@/components/tabsComponent/tabsComponent.vue';
	import {
		onLoad
	} from '@dcloudio/uni-app'
	export default {
		components: {
			auditShopVue,
			tabsComponent
		},
		data() {
			return {
				pageList: [{
					title: '新增商户',
					icon: '/static/icon/xinzeng.png',
					page: '/pages/tabbar/work/pages/addShopUser/addShopUser',
				}, {
					title: '实名认证',
					icon: '/static/icon/shiming.png',
					page: '/pages/tabbar/work/pages/realName/realName',
				}, {
					title: '风控申诉',
					icon: '/static/icon/fengkong.png',
					page: '',
				}, {
					title: '活动报名',
					icon: '/static/icon/huodong.png',
					page: '',
				}, {
					title: '碰一下',
					icon: '/static/icon/nfc.png',
					page: '',
				}, ],
				list: [{
					name: '待提交',
					id: 3
				}, {
					name: '审核中',
					id: 0
				}, {
					name: '驳回',
					id: 2
				}, {
					name: '通过',
					id: 1
				}],
				items: {
					name: '陈倩',
					status: '1',
					createTime: '2024-12-03 10:13:52',
					money: '192.89元',
					fee: '15.43元',
					agent: '代理商'
				},
				userInfo: {},
				currentIndex: 3
			};
		},
		methods: {
			click(e) {
				console.log(e)
				this.currentIndex = e.id
				this.getStoreList()
			},
			async getStoreList() {
				let data = {
					account: this.userInfo.userName,
					auditStatus: this.currentIndex,
					businessName: '',
					businessPhone: '',
					endTime: '',
					name: '',
					pageNum: 0,
					pageSize: 0,
					startTime: '',
					status: '',
					storeName: '',
					wxAuthStatus: '',
					zfbAuthStatus: ''
				}
				let res = await storeListApi(data)
				console.log(res);
				// this.items = res.data.list
			}
		},
		onLoad() {
			this.userInfo = uni.getStorageSync('userInfo')
			console.log(this.userInfo);
			this.getStoreList()
		}
	}
</script>

<style lang="scss" scoped>
	.search-area {
		background-color: rgba(0, 0, 0, 0.1);
		border-radius: 20rpx;
	}
</style>